/**
 * Project: complex.java
 * 
 * File Created at 2010-4-28
 * $Id$
 * 
 * Copyright 2008 Alibaba.com Croporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */
package complex.java.classloader;

/**
 * @description:XXX
 * @author gaoliang
 * @date 2010-4-28
 * @version 1.0
 */
public class ClassLoaderTest {
    public static void main(String[] args) {
        //BootStrapClassLoader加载的class
        System.out.println(System.getProperty("sun.boot.class.path"));
        //ExtClassLoader加载的class
        System.out.println(System.getProperty("java.ext.dirs"));
        //AppClassLoader加载的class
        System.out.println(System.getProperty("java.class.path"));
        try {
            //若此complex.classloader.TestBean在jre/lib/ext下,则会由ExtClassLoader加载
            //正常情况下,都是由AppClassLoader加载
            Class typeLoaded  = Class.forName("complex.classloader.TestBean");
            System.out.println(typeLoaded.getClassLoader());
            
            //
            System.out.println(ClassLoaderTest.class.getClassLoader());
            
        } catch (ClassNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
